<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
namespace core;
defined('BY_JYA') or exit('error');
class mass{
	//会员列表群发
	public function task_typenum($saletask_type=1) {
		//显示统计数据
		$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
		$times=$saletask_set['timesdays']*24*3600;
		$params=array('uniacid'=>$_SESSION['uniacid'],'is_virtual'=>0);
		if($saletask_type==2){//近3月新会员
			$params['createtime >']=TIMESTAMP-90*24*3600;
		}elseif($saletask_type==9){//指定手机
			$params['mobile']=$saletask_set['mobile'];
		}elseif($saletask_type==13){//付费会员特价体验
			$params['level_id']=0;
		}
		$count=pdo_count('core_members',$params);
		$params=array('uniacid'=>$_SESSION['uniacid']);
		if($saletask_type==1){//自定义人群			
				if($saletask_set['datatype']==1){//订单数据
					if($saletask_set['isjiaoyu']==1){//没订单
						if($times){
							$params['createtime >']=TIMESTAMP-$times;
						}
						$count=pdo_count('core_paylog',$params);
					}elseif($saletask_set['isjiaoyu']==2){//有订单未支付
						$params['status']=0;
						if($times){
							$params['createtime >']=TIMESTAMP-$times;
						}
						$count=pdo_count('core_paylog',$params);
					}else{//已消费
						$params['status']=1;
						if($times){
							$params['createtime >']=TIMESTAMP-$times;
						}
						$count=pdo_count('core_paylog',$params);
					}
				}elseif($saletask_set['datatype']==2){//粉丝数据
					
				}elseif($saletask_set['datatype']==3){//活动日
				}else{
					//exi('自定义人群,没有任何参数或数据类型错误，无法推送信息！','error');
				}
			}elseif($saletask_type==2){//未消费新增用户
				$params['status']=1;
				$count=pdo_count('core_paylog',$params);
			}elseif($saletask_type==3){//兴趣人群转化
				$params['status']=0;
				$params['createtime >']=TIMESTAMP-7*24*3600;
				$count=pdo_count('core_paylog',$params,'id');
			}elseif($saletask_type==4){//互动粉丝用户
				
			}elseif($saletask_type==5){//需重点召回客户
				$params['createtime >']=TIMESTAMP-90*24*3600;
				$count=pdo_count('core_paylog',$params);
			}elseif($saletask_type==6){//需重点发展客户
				$params['status']=1;
				$params['createtime >']=TIMESTAMP-30*24*3600;
				$count=pdo_count('core_paylog',$params);
				
			}elseif($saletask_type==7){//需重点活跃客户
				$params['createtime >']=TIMESTAMP-30*24*3600;
				$count=pdo_count('core_paylog',$params);
			}elseif($saletask_type==8){//需刺激消费客户
				$params['createtime >']=TIMESTAMP-30*24*3600;
				$count=pdo_count('core_paylog',$params);
			}elseif($saletask_type==9){//指定手机客户
				
			}elseif($saletask_type==10){//会员日营销
			}elseif($saletask_type==11){//生日营销
			}elseif($saletask_type==12){//节日营销
			}elseif($saletask_type==13){//付费会员特价体验
			}
		return $count;
	}
}